﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Check_Encoding
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length >= 1)
            {
                foreach (string i in args)
                {
                    Console.WriteLine(Encoding.Unicode.GetBytes(i).ToString());
                }
                Console.Read();
            }
            else
            {
                Console.WriteLine("Enter 'Quit' to Exit \r\n");
                while (true)
                {
                    Console.WriteLine("Enter a String: ");
                    string tmp = Console.ReadLine();
                    if (tmp == "Quit") break;
                    if (tmp != null)
                    {
                        byte[] tmp2 = Encoding.Unicode.GetBytes(tmp);
                        foreach (byte i in tmp2)
                        {
                            if (i == 0) break;
                            Console.WriteLine("Hex Val: 0x{0:X},   Int Val: {1},    Orig: {2}", i, i.ToString(), tmp);
                        }
                        Console.WriteLine("Orig: " + Encoding.Unicode.GetString(tmp2));
                    }
                    else
                    {
                        Console.WriteLine("Dont enter a Blank String!!!");
                    }

                }
            }
        }
    }
}
